package com.lam.system.entity;

import java.util.Date;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Null;
import javax.validation.constraints.Size;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.lam.common.base.domain.BaseEntity;
import com.lam.common.components.dict.annotation.Dict;
import com.lam.common.components.easyexcel.converter.DictConverter;
import com.lam.common.utils.DateUtil;
import com.lam.common.validate.annotation.DictCheck;
import com.lam.common.validate.annotation.DictValid;
import com.lam.common.validate.group.Add;

/**
 * 国际化管理对象 sys_language
 * 
 * @author admin
 * @date 2022-08-31
 */
@DictCheck
@ColumnWidth(30)
@TableName("sys_language")
public class SysLanguage implements BaseEntity{

    /** 主键 */
    @ExcelIgnore
    @Null(groups = Add.class, message="id必须为空")
    @TableId(type = IdType.AUTO)
    private String id;
    
    /** 业务类别 */
    @ExcelProperty(value = "业务类别", converter = DictConverter.class)
    @NotBlank(message = "业务类别不能为空")
    @Size(max = 20, message = "业务类别长度不能超过20个字符")
    @DictValid(message = "无效的业务类别")
    @Dict(dictCode = "sysLanguageCategory")
    private String category;

    /** 类型 */
    @ExcelProperty(value = "类型", converter = DictConverter.class)
    @NotBlank(message = "类型不能为空")
    @Size(max = 32, message = "类型长度不能超过32个字符")
    @DictValid(message = "无效的类型")
    @Dict(dictCode = "sysLanguageType")
    private String type;

    /** 关键字 */
    @ExcelProperty("关键字")
    @NotBlank(message = "关键字不能为空")
    @Size(max = 50, message = "关键字长度不能超过50个字符")
    private String langKey;

    /** 值 */
    @ExcelProperty("值")
    @NotBlank(message = "值不能为空")
    @Size(max = 200, message = "值长度不能超过200个字符")
    private String value;

    /** 语言 */
    @ExcelProperty(value = "语言", converter = DictConverter.class)
    @Size(max = 10, message = "语言长度不能超过10个字符")
    @DictValid(message = "无效的语言")
    @Dict(dictCode = "sysLanguage")
    private String lang;

    /** 创建人 */
    @ExcelIgnore
    private String createBy;

    /** 创建日期 */
    @ExcelIgnore
    @JsonFormat(pattern = DateUtil.PATTERN_DEFAULT)
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    /** 更新人 */
    @ExcelProperty("更新人")
    private String updateBy;

    /** 更新日期 */
    @ExcelProperty("更新日期")
    @JsonFormat(pattern = DateUtil.PATTERN_DEFAULT)
    @TableField(fill = FieldFill.UPDATE)
    private Date updateTime;

    public void setId(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    } 

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public String getCreateBy() {
        return createBy;
    }    
    
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getCreateTime() {
        return createTime;
    }    
    
    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    public String getUpdateBy() {
        return updateBy;
    }    
    
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }    
    
    public void setCategory(String category) {
        this.category = category;
    }

    public String getCategory() {
        return category;
    }    
    
    public void setType(String type) {
        this.type = type;
    }

    public String getType() {
        return type;
    }    
    
    public void setLangKey(String langKey) {
        this.langKey = langKey;
    }

    public String getLangKey() {
        return langKey;
    }    
    
    public void setValue(String value) {
        this.value = value;
    }

    public String getValue() {
        return value;
    }    
    
    public void setLang(String lang) {
        this.lang = lang;
    }

    public String getLang() {
        return lang;
    }    
    

}
